<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2022-10-07
 * Time: 19:16
 */

namespace App\controller\baidu;
use support\Request;
class Index
{
    public function index(Request $request)
    {
        $url = 'https://openapi.baidu.com/oauth/2.0/authorize?';
        $arr = [
            'response_type' => 'code',
            'client_id' => 'QF8ctol3Hb18XM06R53LjfaXw9GoHVMF',
            'redirect_uri'=>'https://webman.wyx2013.cn/baidu/auth',
            'scope'=>'netdisk',
            'state'=>$request->get('state','')
        ];
        $url=$url.http_build_query($arr);
        return redirect($url);
    }
}